#include <stdio.h>

int gcd(int m,int n)
{
	int o = m%n;
	while(o)
	{  
	   m = n;
	   n = o;
	   o =  m %n; 
			}
	
	return n;
	
}
  int  lcm(int a,int b,int c)
  {
  	return (a*b)/c;
  }


int main()
{
	int x, y;
	scanf("%d%d",&x,&y);
	 gcd(x,y);
	 int l = gcd(x,y);
	 int k = lcm(x,y,l);
	 printf("%d ",l);
	 printf("%d",k);
 	return 0;
}
